﻿using System;
using System.Collections.Generic;
using EnvDTE;
using EnvDTE80;


namespace VsTortoiseSVN.Commands
{
    public class SolutionExplorerSelectedItemsLog : SolutionExplorerSelectedItemsBase
    {
        public SolutionExplorerSelectedItemsLog(DTE2 app, string id)
            : base(app, id)
        {
        }

        protected override vsCommandStatus QueryContextSensitiveStatus()
        {
            List<string> fullNames = GetFullNames();
            if (SvnHelper.IsVersionControlled(fullNames[0]))
                return vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;

            return vsCommandStatus.vsCommandStatusEnabled;
        }

        public override bool Exec()
        {
            List<string> fullNames = GetFullNames();
            TortoiseProc.ShowLog(fullNames[0]);
            return true;
        }
    }
}
